<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import { watchEffect } from 'vue';
import { RouterView } from 'vue-router';
import { useAuthStore } from './store/user';
import jwtDecode from 'jwt-decode';
const store = useAuthStore();
  watchEffect(()=>{
    if(localStorage.token){
      const decode = jwtDecode(localStorage.token);
      store.setAuth(!!decode);
      store.setUser(decode);
    }
  })
onLaunch(() => {
  console.log("App Launch");
});
onShow(() => {
  console.log("App Show");
});
onHide(() => {
  console.log("App Hide");
});
</script>
<style></style>
